import Vue from 'vue';
import modal from './modal';
const ModalConstructor = Vue.extend(modal);
const div = document.createElement('div');
ModalConstructor.show = (options) => {
  document.body.appendChild(div);
  options.type = 'inform';
  const propsData = Object.assign({}, options);
  const alertInstance = new ModalConstructor({
    propsData,
  }).$mount(div);
  alertInstance.show();
};
ModalConstructor.confirm = (options) => {
  document.body.appendChild(div);
  options.type = 'confirm';
  const propsData = Object.assign({}, options);
  const alertInstance = new ModalConstructor({
    propsData,
  }).$mount(div);
  alertInstance.show();
};
export default ModalConstructor;
